import type { Socket } from 'socket.io-client';
// import {Emi} from 'mitt'
import { io } from 'socket.io-client';

export default function useSocket(socketId: number): Socket {
    const URL = 'http://localhost:5555';
    const socket = io(URL);
    socket.on('connect', () => {
        socket.emit('setSocketId', socketId);
    });
    return socket;
}
